//
//  KJSRequest.m
//  Kjs
//
//  Created by cfq on 16/5/25.
//  Copyright © 2016年 kjs. All rights reserved.
//

#import "KJSRequest.h"
#import "GUAServerRequest.h"


@implementation KJSRequest

+ (void)LoginWithUsername:(NSString *)username
                 Password:(NSString *)password
                      ret:(void (^)(UserInfo *))ret
{
    NSString *url = @"/kjsapi/control/login";
    NSDictionary *dic = @{
                          @"USERNAME":username,
                          @"PASSWORD":password
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        //        LoginResultModel *result = [[LoginResultModel alloc] initWithDictionary:responseObject];
        UserInfo *userinfo = [[UserInfo alloc] initWithDictionary:responseObject];
        ret(userinfo);
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}

+ (void)GetIndexItemsWithRows:(int)rows ret:(void (^)(IndexItemsModel *))ret
{
    NSString *url = @"/kjsapi/control/recommendItem";
    NSDictionary *dic = @{
                          @"rows":@(rows)
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        IndexItemsModel *result = [[IndexItemsModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
    
}

+ (void)GetItemByCondtionWithPage:(int)page Rows:(int)rows Sordid:(NSString *)sordid sord:(NSString *)sord Filter:(NSString *)filter ret:(void (^)(ItemByCondModel *))ret
{
    NSString *url = @"/kjsapi/control/items";
    NSDictionary *dic =@{
                         @"page":@(page),
                         @"rows":@(rows),
                         @"sordid":sordid,
                         @"sord":sord,
                         @"filter":filter
                         };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        ItemByCondModel *result = [[ItemByCondModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetItemDetailWithItemId:(NSString *)itemId page:(int)page rows:(int)rows ret:(void (^)(ItemDetailModel *))ret
{
    NSString *url = @"/kjsapi/control/item";
    NSDictionary *dic = @{
                          @"itemId":itemId,
                          @"page":@(page),
                          @"rows":@(rows)
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        ItemDetailModel *result = [[ItemDetailModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetUserAccountAssetsInfoWithPartyId:(NSString *)partyId ret:(void(^)(UserVirtualAccountModel *model))ret
{
    NSString *url = @"/kjsapi/control/getUserVirtualAccount";
    NSDictionary *dic = @{
                          @"partyId":partyId,
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        UserVirtualAccountModel *result = [[UserVirtualAccountModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
    
};
/*获取投资记录接口*/
+ (void)GetUserOrderListWithPartyId:(NSString *)partyId IDisplayStart:(int)startPos IDisplayLength:(int)length ret:(void(^)(InvestRecordModel *model))ret
{
    NSString *url = @"/kjsapi/control/getUserOrderListByPages";
    NSDictionary *dic = @{
                          @"partyId":partyId,
                          @"iDisplayStart":@(startPos),
                          @"iDisplayLength":@(length)
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        InvestRecordModel *result = [[InvestRecordModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetUserInvestItemWithPartyId:(NSString *)partyId page:(int)page rows:(int)rows itemStatus:(int)itemStatus ret:(void (^)(InvestItemModel *))ret
{
    NSString *url = @"/kjsapi/control/getInvestItem";
    NSDictionary *dic = @{
                          @"partyId":partyId,
                          @"page":@(page),
                          @"rows":@(rows),
                          @"itemStatus":@(itemStatus)
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        InvestItemModel *result = [[InvestItemModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetRaiseRecordWithPartyId:(NSString *)partyId page:(int)page rows:(int)rows ret:(void (^)(RaiseRecordModel *))ret
{
    NSString *url = @"/kjsapi/control/getRaiseRecord";
    NSDictionary *dic = @{
                          @"partyId":partyId,
                          @"page":@(page),
                          @"rows":@(rows),
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSLog(@"成功了1");
        RaiseRecordModel *result = [[RaiseRecordModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetRaiseItemWithPartyId:(NSString *)partyId page:(int)page rows:(int)rows itemStatus:(int)itemStatus ret:(void (^)(RaiseItemModel *))ret
{
    NSString *url = @"/kjsapi/control/myraise";
    NSDictionary *dic = @{
                          @"partyId":partyId,
                          @"page":@(page),
                          @"rows":@(rows),
                          @"itemStatus":@(itemStatus)
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        RaiseItemModel *result = [[RaiseItemModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetUserInvestLogListWithPartyId:(NSString *)partyId start:(int)start length:(int)length ret:(void (^)(FinanceLogModel *))ret
{
    NSString *url = @"/kjsapi/control/getUserInvestLogList";
    NSDictionary *dic = @{
                          @"partyId":partyId,
                          @"start":@(start),
                          @"length":@(length),
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        FinanceLogModel *result = [[FinanceLogModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetUserRaiseLogListWithPartyId:(NSString *)partyId start:(int)start length:(int)length ret:(void (^)(FinanceLogModel *))ret
{
    NSString *url = @"/kjsapi/control/getUserRaiseLogList";
    NSDictionary *dic = @{
                          @"partyId":partyId,
                          @"start":@(start),
                          @"length":@(length),
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        FinanceLogModel *result = [[FinanceLogModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetUserCashLogListWithPartyId:(NSString *)partyId start:(int)start length:(int)length ret:(void (^)(FinanceLogModel *))ret
{
    NSString *url = @"/kjsapi/control/getUserRechargeAndWithdrawLogList";
    NSDictionary *dic = @{
                          @"partyId":partyId,
                          @"start":@(start),
                          @"length":@(length),
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        FinanceLogModel *result = [[FinanceLogModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetBankCardListWithPartyId:(NSString *)partyId ret:(void (^)(BankCardModel *))ret
{
    NSString *url = @"/kjsapi/control/findAppBankCard";
    NSDictionary *dic = @{
                          @"partyId":partyId,
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BankCardModel *result = [[BankCardModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)GetINdexImageWithRet:(void(^)(IndexImageModel *model))ret
{
    NSString *url = @"/kjsapi/control/getImagesForApp";
    NSDictionary *dic = @{};
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        IndexImageModel *result = [[IndexImageModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+ (void)PayOrderWithVerificationCode:(NSString *)verificationCodecode partyId:(NSString *)partyId itemId:(NSString *)itemId totalPrice:(NSString *)totalPrice tradePwd:(NSString *)tradePwd orderPayModeNamePinYin:(NSString *)orderPayModeNamePinYin bankCardId:(NSString *)bankCardId comments:(NSString *)comments ret:(void (^)(PayOrderModel *))ret
{
    NSString *url = @"/kjsapi/control/acceptMessageAndOrder";
    NSDictionary *dic = @{@"verificationCode":verificationCodecode,
                          @"partyId":partyId,
                          @"itemId":itemId,
                          @"totalPrice":totalPrice,
                          @"tradePwd":tradePwd,
                          @"orderPayModeNamePinYin":orderPayModeNamePinYin,
                          @"bankCardId":bankCardId,
                          @"comments":comments};
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        PayOrderModel *result = [[PayOrderModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
    
}
+(void)RemoveAppBankCardWithPartyId:(NSString *)partyId bankCardId:(NSString *)bankCardId tradePwd:(NSString *)tradePwd ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/removeAppBankCard";
    NSDictionary *dic = @{@"bankCardId":bankCardId,
                          @"partyId":partyId,
                          @"tradePwd":tradePwd
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)GetPRealAuthInfoWithPartyId:(NSString *)partyId ret:(void (^)(PRealAuthResultModel *))ret
{
    NSString *url = @"/kjsapi/control/kjsApiGetPRealAuthInfo";
    NSDictionary *dic = @{@"partyId":partyId
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        PRealAuthResultModel *result = [[PRealAuthResultModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)GetORealAuthInfoWithPartyId:(NSString *)partyId ret:(void (^)(ORealAuthResultModel *))ret
{
    NSString *url = @"/kjsapi/control/kjsApiGetORealAuthInfo";
    NSDictionary *dic = @{@"partyId":partyId
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        ORealAuthResultModel *result = [[ORealAuthResultModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)RegisterAcceptMessageWithPhoneNumber:(NSString *)phoneNumber userLoginId:(NSString *)userLoginId password:(NSString *)password verificationCode:(NSString *)verificationCode ret:(void (^)(RegisterModel *))ret
{
    NSString *url = @"/kjsapi/control/IOSRegisterAcceptMessage";
    NSDictionary *dic = @{@"phoneNumber":phoneNumber,
                          @"userLoginId":userLoginId,
                          @"password":password,
                          @"verificationCode":verificationCode
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        RegisterModel *result = [[RegisterModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
    
}
+(void)RegisterSendMessageWithPhoneNumber:(NSString *)phoneNumber ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/registersendmessage";
    NSDictionary *dic = @{@"phoneNumber":phoneNumber
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)updateLoginPswAcceptMessageWithNewPw:(NSString *)newpw phoneNumber:(NSString *)phoneNumber verificationCode:(NSString *)verificationCode ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/updateLoginPasswordAcceptMessage";
    NSDictionary *dic = @{@"newpw":newpw,
                          @"phoneNumber":phoneNumber,
                          @"verificationCode":verificationCode
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)updateLoginPswSendMessageWithPhoneNumber:(NSString *)phoneNumber ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/ResetLoginPasswordSendMessage";
    NSDictionary *dic = @{@"phoneNumber":phoneNumber
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
    
}
+(void)BindTelWithUserLoginId:(NSString *)userLoginId verificationCode:(NSString *)verificationCode ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/ApiUpdateTelAcceptMessage";
    NSDictionary *dic = @{@"userLoginId":userLoginId,
                          @"verificationCode":verificationCode
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
    
}
+(void)BindTelSendMessageWithPhoneNumber:(NSString *)phoneNumber ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/telphoneSendMessage";
    NSDictionary *dic = @{@"phoneNumber":phoneNumber
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)AlterLoginPasswordWithOldPw:(NSString *)oldpw newpw:(NSString *)newpw phoneNumber:(NSString *)phoneNumber ret:(void (^)(BasicResult *))ret
{
    
    NSString *url = @"/kjsapi/control/alterLoginPassword";
    NSDictionary *dic = @{@"oldpw":oldpw,
                          @"newpw":newpw,
                          @"phoneNumber":phoneNumber
                          };
    NSLog(@"old=%@,new=%@,phone=%@",oldpw,newpw,phoneNumber);
    
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)SetTradePswWithTradePwd:(NSString *)tradePwd partyId:(NSString *)partyId phoneNumber:(NSString *)phoneNumber verificationCode:(NSString *)verificationCode ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/createTradePasswordAcceptMessage";
    NSDictionary *dic = @{@"tradePwd":tradePwd,
                          @"partyId":partyId,
                          @"phoneNumber":phoneNumber,
                          @"verificationCode":verificationCode
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)SetTradePswSendMessageWithPhoneNumber:(NSString *)phoneNumber
                                    sendName:(NSString *)sendname
                                         ret:(void (^)(BasicResult *))ret
{
    
    NSString *url = @"/kjsapi/control/createTradePasswordSendMessage";
    NSDictionary *dic = @{@"phoneNumber":phoneNumber,
                          @"sendName":sendname
                          };
    NSLog(@"sendname=%@",sendname);
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)UpdateTradePasswordWithTradePwd:(NSString *)tradePwd oldTradePwd:(NSString *)oldTradePwd partyId:(NSString *)partyId ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/updateTradePassword";
    NSDictionary *dic = @{@"tradePwd":tradePwd,
                          @"oldTradePwd":oldTradePwd,
                          @"partyId":partyId
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)AddBankCardWithPartyId:(NSString *)partyId verificationCode:(NSString *)verificationCode bankCardNameType:(NSInteger)bankCardNameType bankCardNum:(NSString *)bankCardNum bankCardPhone:(NSString *)bankCardPhone ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/acceptAddBankCardMessage";
    NSDictionary *dic = @{@"partyId":partyId,
                          @"verificationCode":verificationCode,
                          @"bankCardNameType":@(bankCardNameType),
                          @"bankCardNum":bankCardNum,
                          @"bankCardPhone":bankCardPhone
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)AddBankCardSendMessageWithBankCardPhone:(NSString *)bankCardPhone sendName:(NSString *)sendName ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/AppBankCardSendMessage";
    NSDictionary *dic = @{@"bankCardPhone":bankCardPhone,
                          @"sendName":sendName
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
    
}
+(void)PersonReRealAuthWithPartyId:(NSString *)partyId pName:(NSString *)pName pIdNum:(NSString *)pIdNum ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/kjsApiPReRealAuth";
    NSDictionary *dic = @{@"partyId":partyId,
                          @"pName":pName,
                          @"pIdNum":pIdNum
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)OrgRealAuthWithPartyId:(NSString *)partyId oCompanyName:(NSString *)oCompanyName oUan:(NSString *)oUan oRepresentName:(NSString *)oRepresentName oRepresentPhone:(NSString *)oRepresentPhone oRepresentIdNum:(NSString *)oRepresentIdNum oRepresentIdNumFile:(NSData *)oRepresentIdNumFile oCompanyBusinessLicenseFile:(NSData *)oCompanyBusinessLicenseFile oBankPermitLicenseFile:(NSData *)oBankPermitLicenseFile ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/kjsApiORealAuth";
    NSDictionary *dic = @{@"partyId":partyId,
                          @"oCompanyName":oCompanyName,
                          @"oUan":oUan,
                          @"oRepresentName":oRepresentName,
                          @"oRepresentPhone":oRepresentPhone,
                          @"oRepresentIdNum":oRepresentIdNum
                          };
    NSDictionary *dicImages = @{@"oRepresentIdNumFile":oRepresentIdNumFile,
                                @"oCompanyBusinessLicenseFile":oCompanyBusinessLicenseFile,
                                @"oBankPermitLicenseFile":oBankPermitLicenseFile
                                };
    [GUAServerRequest postImageWithUrl:ConnectUrl(url) imageDictionary:dicImages parameters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
}
+(void)OrgReRealAuthWithPartyId:(NSString *)partyId oCompanyName:(NSString *)oCompanyName oUan:(NSString *)oUan oRepresentName:(NSString *)oRepresentName oRepresentPhone:(NSString *)oRepresentPhone oRepresentIdNum:(NSString *)oRepresentIdNum oRepresentIdNumFile:(NSData *)oRepresentIdNumFile oCompanyBusinessLicenseFile:(NSData *)oCompanyBusinessLicenseFile oBankPermitLicenseFile:(NSData *)oBankPermitLicenseFile ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/kjsApiOReRealAuth";
    NSDictionary *dic = @{@"partyId":partyId,
                          @"oCompanyName":oCompanyName,
                          @"oUan":oUan,
                          @"oRepresentName":oRepresentName,
                          @"oRepresentPhone":oRepresentPhone,
                          @"oRepresentIdNum":oRepresentIdNum
                          };
    NSDictionary *dicImages = @{@"oRepresentIdNumFile":oRepresentIdNumFile,
                                @"oCompanyBusinessLicenseFile":oCompanyBusinessLicenseFile,
                                @"oBankPermitLicenseFile":oBankPermitLicenseFile
                                };
    [GUAServerRequest postImageWithUrl:ConnectUrl(url) imageDictionary:dicImages parameters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
}
+(void)PayOrderSendMessageWithPhoneNumber:(NSString *)phoneNumber
                                 sendName:(NSString *)sendName
                                      ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/PaidSendMessage";
    NSDictionary *dic = @{@"phoneNumber":phoneNumber,
                          @"sendName":sendName
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)SubmitItemInfoWithItemStatus:(int)itemStatus partyId:(NSString *)partyId contactName:(NSString *)contactName contactTel:(NSString *)contactTel contactEmail:(NSString *)contactEmail localProvince:(NSString *)localProvince localCity:(NSString *)localCity localCounty:(NSString *)localCounty companyName:(NSString *)companyName teamIntroduction:(NSString *)teamIntroduction itemName:(NSString *)itemName gdFinancingRequired:(NSString *)gdFinancingRequired gdSrcOfRepayment:(NSString *)gdSrcOfRepayment gdIfPledge:(int)gdIfPledge targetMoney:(NSString *)targetMoney gdAnnualizedBenefitRate:(NSString *)gdAnnualizedBenefitRate gdBenefitMode:(int)gdBenefitMode itemType:(NSString *)itemType gdItemType:(int)gdItemType docList:(NSString *)docList ret:(void (^)(BasicResult *))ret
{
    
    NSString *url = @"/kjsapi/control/launchItem";
    NSDictionary *dic = @{@"itemStatus":@(itemStatus),
                          @"partyId":partyId,
                          @"contactName":contactName,
                          @"contactTel":contactTel,
                          @"contactEmail":contactEmail,
                          @"localProvince":localProvince,
                          @"localCity":localCity,
                          @"localCounty":localCounty,
                          @"companyName":companyName,
                          @"teamIntroduction":teamIntroduction,
                          @"itemName":itemName,
                          @"gdFinancingRequired":gdFinancingRequired,
                          @"gdSrcOfRepayment":gdSrcOfRepayment,
                          @"gdIfPledge":@(gdIfPledge),
                          @"targetMoney":targetMoney,
                          @"gdAnnualizedBenefitRate":gdAnnualizedBenefitRate,
                          @"gdBenefitMode":@(gdBenefitMode),
                          @"itemType":itemType,
                          @"gdItemType":@(gdItemType),
                          @"docList":docList
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)mobileUploadFileWithUploadedFile:(NSData *)uploadedFile _uploadedFile_fileName:(NSString *)_uploadedFile_fileName documentType:(NSString *)documentType ret:(void (^)(ImageUploadModel *))ret
{
    NSString *url = @"/kjsapi/control/mobileUploadFile";
    NSDictionary *dic = @{@"filePathOrName":_uploadedFile_fileName,
                          @"documentType":documentType,
                          };
    NSDictionary *imageDic = @{@"uploadedFile":uploadedFile
                               };
    NSLog(@"uploadefiname=%@",_uploadedFile_fileName);
    [GUAServerRequest postImageWithUrl:ConnectUrl(url) imageDictionary:imageDic parameters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        ImageUploadModel *result = [[ImageUploadModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
}
+(void)mobileDeleteItemFileWithKjsItemInfoDocumentId:(NSString *)KjsItemInfoDocumentId ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/mobileDeleteItemFile";
    NSDictionary *dic = @{@"KjsItemInfoDocumentId":KjsItemInfoDocumentId
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
    
}
+(void)submitOfflinePaymentVoucherWithPartyId:(NSString *)partyId orderId:(NSString *)orderId uploadedFile:(NSData *)uploadedFile _uploadedFile_fileName:(NSString *)_uploadedFile_fileName _uploadedFile_contentType:(NSString *)_uploadedFile_contentType dateResourceId:(NSString *)dateResourceId fileExtensionId:(NSString *)fileExtensionId ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/submitOfflinePaymentVoucher";
    NSDictionary *dic = @{@"partyId":partyId,
                          @"orderId":orderId,
                          @"_uploadedFile_fileName":_uploadedFile_fileName,
                          @"_uploadedFile_contentType":_uploadedFile_contentType,
                          @"dateResourceId":dateResourceId,
                          @"fileExtensionId":fileExtensionId,
                          };
    NSDictionary *imgDic = @{@"uploadedFile":uploadedFile
                             };
    [GUAServerRequest postImageWithUrl:ConnectUrl(url) imageDictionary:imgDic parameters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
    
}

+(void)getAppMassMessageWithPartyId:(NSString *)partyId
                             inPage:(NSInteger)page
                             ofRows:(NSInteger)rows
                                ret:(void(^)(MassMessageModel *model))ret {
    NSString *url = @"/kjsapi/control/getAppMassMessage";
    NSDictionary * dic = @{@"partyId":partyId,
                           @"page":@(page),
                           @"rows":@(rows),
                           };
    [GUAServerRequest POSTWithURL:ConnectUrl(url)
                       paramaters:dic
                          success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
                              MassMessageModel * result = [[MassMessageModel alloc] initWithDictionary:responseObject];
                              ret(result);
                          } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
                              //
                          } inView:nil];
}

+(void)getAppMassMessageDetailWithUserReceiveMessageId:(NSString *)userReceiveMessageId
                                                   ret:(void(^)(MassMessageDetailModel *model))ret {
    NSString *url = @"/kjsapi/control/getAppMassMessageDetail";
    NSDictionary * dic = @{@"userReceiveMessageId":userReceiveMessageId};
    [GUAServerRequest POSTWithURL:ConnectUrl(url)
                       paramaters:dic
                          success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
                              MassMessageDetailModel * result = [[MassMessageDetailModel alloc] initWithDictionary:responseObject];
                              ret(result);
                          } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
                              //
                          } inView:nil];
}

+(void)getPlatformInfoForAppWithSign:(NSString *)sign  //sign 0: 帮助中心, 1: 平台简介, 2: 联系我们
                                 Ret:(void(^)(BriefIntroModel *model))ret {
    NSString *url = @"/kjsapi/control/platformInfoForApp";
    NSDictionary * dic = @{@"sign":sign,};
    [GUAServerRequest POSTWithURL:ConnectUrl(url)
                       paramaters:dic
                          success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
                              BriefIntroModel * result = [[BriefIntroModel alloc] initWithDictionary:responseObject];
                              ret(result);
                          } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
                              //
                          } inView:nil];
}
+(void)getNewsListWithPage:(NSString *)page rows:(NSString *)rows ret:(void (^)(PlatformNewsModel *))ret
{
    NSString *url = @"/kjsapi/control/showTrendsListForApp";
    NSDictionary *dic = @{@"page":page,
                          @"rows":rows
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        PlatformNewsModel *result = [[PlatformNewsModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];

}
+(void)getNewsDetailWithplatformNewsId:(NSString *)platformNewsId ret:(void (^)(PlatformNewsModel *))ret
{
    NSString *url = @"/kjsapi/control/trendsDetailsForApp";
    NSDictionary *dic = @{@"platformTrendsId":platformNewsId
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        PlatformNewsModel *result = [[PlatformNewsModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}

+(void)feedbackToAdminWithPartyId:(NSString *)partyId
                          Content:(NSString *)content
                           Source:(NSString *)source    //信息来源端 web 0, android 1,ios 2,webapp 3
                              ret:(void(^)(BasicResult *model))ret {
    NSString *url = @"/kjsapi/control/feedbackToAdmin";
    NSDictionary *dic = @{@"partyId":partyId,
                          @"source":source,
                          @"content":content
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}

/*获取新闻详情*/
+(void)getNewsDetailsForAppWithPlatformNewsId:(NSString *)platformNewsId
                                          ret:(void(^)(NewsListModel *model))ret {
    NSString *url = @"/kjsapi/control/newsDetailsForApp";
    NSDictionary *dic = @{@"platformNewsId":platformNewsId
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NewsListModel *result = [[NewsListModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
/*获取新闻列表*/
+(void)showNewsListForAppAtPage:(NSString *)page
                           rows:(NSString *)rows
                            ret:(void(^)(NewsListModel *model))ret {
    NSString *url = @"/kjsapi/control/showNewsListForApp";
    NSDictionary *dic = @{@"page":page,
                          @"rows":rows
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NewsListModel *result = [[NewsListModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
/*获取平台动态详情*/
+(void)getTrendsDetailsForAppWithPlatformTrendsId:(NSString *)platformTrendsId
                                              ret:(void(^)(NewsListModel *model))ret {
    NSString *url = @"/kjsapi/control/trendsDetailsForApp";
    NSDictionary *dic = @{@"platformTrendsId":platformTrendsId};
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NewsListModel *result = [[NewsListModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
/*获取平台动态列表*/
+(void)showTrendsListForAppAtPage:(NSString *)page
                             rows:(NSString *)rows
                              ret:(void(^)(NewsListModel *model))ret {
    NSString *url = @"/kjsapi/control/showTrendsListForApp";
    NSDictionary *dic = @{@"page":page,
                          @"rows":rows
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NewsListModel *result = [[NewsListModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];

}

+(void)getPlatformInfoForAppWithSign:(NSString *)sign  //sign 0: 帮助中心, 1: 平台简介, 2: 联系我们
                                 ret:(void(^)(BriefIntroModel *model))ret {
    NSString *url = @"/kjsapi/control/platformInfoForApp";
    NSDictionary *dic = @{@"sign":sign};
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BriefIntroModel *result = [[BriefIntroModel alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}


+(void)setAppDefaultCardWithPartyId:(NSString *)partyId bankCardId:(NSString *)bankCardId ret:(void (^)(BasicResult *))ret
{
    NSString *url = @"/kjsapi/control/setAppDefaultCard";
    NSDictionary *dic = @{@"partyId":partyId,
                          @"bankCardId":bankCardId
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)vaildOrgRepresentSendMessageWithPhone:(NSString *)phoneNumber sendName:(NSString *)sendName ret:(void(^)(BasicResult *model))ret
{
    NSString *url = @"/kjsapi/control/organizationPersonSendMessage";
    NSDictionary *dic = @{@"phoneNumber":phoneNumber,
                          @"sendName":sendName
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
+(void)vaildOrgrepresentWithVerificationCode:(NSString *)verificationCode PartyId:(NSString *)partyId ret:(void(^)(BasicResult *model))ret
{
    NSString *url = @"/kjsapi/control/organizationPersonAcceptMessage";
    NSDictionary *dic = @{@"verificationCode":verificationCode,
                          @"partyId":partyId
                          };
    [GUAServerRequest POSTWithURL:ConnectUrl(url) paramaters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        BasicResult *result = [[BasicResult alloc] initWithDictionary:responseObject];
        ret(result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    } inView:nil];
}
@end
